\documentclass{article}
\usepackage{tikz,amsmath}
\usetikzlibrary{arrows.meta}
\usepackage[graphics,tightpage,active]{preview}
\PreviewEnvironment{tikzpicture}
\begin{document}
\begin{tikzpicture}[>=Stealth]
    \draw (0, 0) -- (3, 0);
    \foreach \x / \name in {0/$A$, 3/$B$} {
        \draw (\x, 0) -- (\x, 0.1) node[anchor=south] {\name};
    }

    \draw (0,0) -- (0.4, 0.5) -- (1.2, 0.3) -- (1.5, 0.6) -- (2.1, 0.3) -- (2.5, 0.5) -- (3, 0);
    \draw (0,0) .. controls (1,-0.5) and (2, -0.5) .. (3, 0);
\end{tikzpicture}
\end{document}
